package com.shkmall.goods.dao;

import com.shkmall.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {

    @Select("SELECT name,image FROM tb_brand where id in(select brand_id from tb_category_brand where category_id in(SELECT id from tb_category WHERE name = #{categoryName}))")
    List<Brand> findBrandByCategoryName(@Param("categoryName") String categoryName);
}
